package com.yan.thread;

/**
 * @author taoge
 * @Date 2024/8/7 15:36
 * @Description
 */
public class ThreadDemo4 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new MyTesk04() , "线程A");
        t1.start();
        for (int i = 200; i < 300; i++) {
            System.out.println(Thread.currentThread().getName() +"---" + i);
            Thread.sleep(1);
        }

    }
}

class MyTesk04 implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + "--" + i);
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
